rtorrent: import from packages and update to 0.9.4
authorPeter Wagner <[email protected]>
Mon, 16 Jun 2014 09:41:05 +0000 (11:41 +0200)
committerPeter Wagner <[email protected]>
Mon, 16 Jun 2014 09:53:44 +0000 (11:53 +0200)
libtorrent: import from packages and update to 0.13.4

Signed-off-by: Peter Wagner <[email protected]>
libs/libtorrent/Makefile [new file with mode: 0644]
libs/libtorrent/patches/100-fix_cross_compile.patch [new file with mode: 0644]
libs/libtorrent/patches/120-fix-ipv6_socket_datagram.patch [new file with mode: 0644]
net/rtorrent/Makefile [new file with mode: 0644]
net/rtorrent/patches/100-fix-cross_compile.patch [new file with mode: 0644]
net/rtorrent/patches/120-fix-ncurses.patch [new file with mode: 0644]

diff --git a/libs/libtorrent/Makefile b/libs/libtorrent/Makefile
new file mode 100644 (file)
index 0000000..80421f3
--- /dev/null
@@ -0,0 +1,71 @@
+#
+# Copyright (C) 2007-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libtorrent
+PKG_VERSION:=0.13.4-git
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/rakshasa/libtorrent.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=51cd5ea8913a5f5062813d9f5b6256c76d41ea11
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libtorrent
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Rakshasa's BitTorrent library
+  URL:=http://libtorrent.rakshasa.no/
+  DEPENDS:=+libopenssl +libsigcxx
+endef
+
+define Package/libtorrent/description
+ LibTorrent is a BitTorrent library written in C++ for *nix, with a focus on
+ high performance and good code. The library differentiates itself from other
+ implementations by transfering directly from file pages to the network stack.
+ On high-bandwidth connections it is able to seed at 3 times the speed of the
+ official client.
+endef
+
+TARGET_LDFLAGS += $(LIBGCC_S)
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --enable-static \
+       --enable-aligned \
+       --disable-debug \
+       --enable-openssl \
+       --disable-instrumentation
+
+define Build/Configure
+       ( cd $(PKG_BUILD_DIR); ./autogen.sh );
+       $(call Build/Configure/Default)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/torrent $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtorrent.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libtorrent/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libtorrent))
diff --git a/libs/libtorrent/patches/100-fix_cross_compile.patch b/libs/libtorrent/patches/100-fix_cross_compile.patch
new file mode 100644 (file)
index 0000000..202ee00
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -19,7 +19,6 @@ AC_SUBST(LIBTORRENT_INTERFACE_VERSION_NO
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_HEADERS(config.h)
+-AM_PATH_CPPUNIT(1.9.6)
+ AC_PROG_CXX
+--- a/scripts/checks.m4
++++ b/scripts/checks.m4
+@@ -96,7 +96,7 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE], [
+ AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [
+   AC_MSG_CHECKING(whether kqueue supports pipes and ptys)
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <fcntl.h>
+       #include <stdlib.h>
+       #include <unistd.h>
+--- a/scripts/common.m4
++++ b/scripts/common.m4
+@@ -223,7 +223,7 @@ dnl   Need to fix this so that it uses t
+ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
+   AC_MSG_CHECKING(for execinfo.h)
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <execinfo.h>
+       int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
+       ])],
+@@ -238,7 +238,7 @@ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
+ AC_DEFUN([TORRENT_CHECK_ALIGNED], [
+   AC_MSG_CHECKING(the byte alignment)
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <inttypes.h>
+       int main() {
+         char buf@<:@8@:>@ = { 0, 0, 0, 0, 1, 0, 0, 0 };
diff --git a/libs/libtorrent/patches/120-fix-ipv6_socket_datagram.patch b/libs/libtorrent/patches/120-fix-ipv6_socket_datagram.patch
new file mode 100644 (file)
index 0000000..1a46627
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/src/net/socket_datagram.cc
++++ b/src/net/socket_datagram.cc
+@@ -73,6 +73,23 @@ SocketDatagram::write_datagram(const voi
+   int r;
+   if (sa != NULL) {
++#ifdef RAK_USE_INET6
++    if (m_ipv6_socket && sa->family() == rak::socket_address::pf_inet) {
++      uint32_t addr32[4];
++      sockaddr_in6 mapped_addr;
++      memset(&mapped_addr, 0, sizeof(mapped_addr));
++      mapped_addr.sin6_family = AF_INET6;
++      addr32[0] = 0;
++      addr32[1] = 0;
++      addr32[2] = htonl(0xffff);
++      addr32[3] = sa->sa_inet()->address_n();
++      memcpy(mapped_addr.sin6_addr.s6_addr, addr32, sizeof(uint32_t) * 4);
++      mapped_addr.sin6_port = sa->sa_inet()->port_n();
++      r = ::sendto(m_fileDesc, buffer, length, 0, (sockaddr*)&mapped_addr, sizeof(mapped_addr));
++    } else if (m_ipv6_socket && sa->family() == rak::socket_address::pf_inet6) {
++      r = ::sendto(m_fileDesc, buffer, length, 0, sa->sa_inet6()->c_sockaddr(), sizeof(rak::socket_address_inet6));
++    } else
++#endif
+     r = ::sendto(m_fileDesc, buffer, length, 0, sa->sa_inet()->c_sockaddr(), sizeof(rak::socket_address_inet));
+   } else {
+     r = ::send(m_fileDesc, buffer, length, 0);
diff --git a/net/rtorrent/Makefile b/net/rtorrent/Makefile
new file mode 100644 (file)
index 0000000..b96fab5
--- /dev/null
@@ -0,0 +1,92 @@
+#
+# Copyright (C) 2007-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rtorrent
+PKG_VERSION:=0.9.4-git
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)-1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/rakshasa/rtorrent.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=6a3234eaa79f15857260df31f98711ef24266191
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/rtorrent/Default
+  SUBMENU:=BitTorrent
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=BitTorrent client for ncurses
+  URL:=http://libtorrent.rakshasa.no/
+  DEPENDS:=+libcurl +libtorrent +libncursesw +libsigcxx +libpthread
+endef
+
+define Package/rtorrent/Default/description
+ rTorrent is a BitTorrent client for ncurses, using the libtorrent library.
+ The client and library is written in C++ with emphasis on speed and
+ efficiency, while delivering equivalent features to those found in GUI based
+ clients in an ncurses client.
+endef
+
+define Package/rtorrent
+$(call Package/rtorrent/Default)
+  VARIANT:=norpc
+endef
+
+define Package/rtorrent/description
+$(call Package/rtorrent/Default/description)
+ This package is built without xmlrpc support
+endef
+
+define Package/rtorrent-rpc
+$(call Package/rtorrent/Default)
+  VARIANT:=rpc
+  DEPENDS+=+xmlrpc-c-server
+  TITLE+=(with rpc support)
+endef
+
+define Package/rtorrent-rpc/description
+$(call Package/rtorrent/Default/description)
+ This package is built with xmlrpc support
+endef
+
+TARGET_LDFLAGS += -lpthread -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+CONFIGURE_ARGS+= \
+       --enable-shared \
+       --disable-static \
+       --disable-debug
+
+ifeq ($(BUILD_VARIANT),rpc)
+       CONFIGURE_ARGS += \
+               --with-xmlrpc-c
+endif
+
+
+define Build/Configure
+       ( cd $(PKG_BUILD_DIR); ./autogen.sh );
+       $(call Build/Configure/Default)
+endef
+
+define Package/rtorrent/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rtorrent $(1)/usr/bin/
+endef
+
+Package/rtorrent-rpc/install = $(Package/rtorrent/install)
+
+$(eval $(call BuildPackage,rtorrent))
+$(eval $(call BuildPackage,rtorrent-rpc))
diff --git a/net/rtorrent/patches/100-fix-cross_compile.patch b/net/rtorrent/patches/100-fix-cross_compile.patch
new file mode 100644 (file)
index 0000000..203544e
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -4,7 +4,6 @@ AC_DEFINE(API_VERSION, 8, api version)
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_HEADERS(config.h)
+-AM_PATH_CPPUNIT(1.9.6)
+ AC_PROG_CXX
+ AC_PROG_LIBTOOL
+--- a/scripts/common.m4
++++ b/scripts/common.m4
+@@ -223,7 +223,7 @@ dnl   Need to fix this so that it uses t
+ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
+   AC_MSG_CHECKING(for execinfo.h)
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <execinfo.h>
+       int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
+       ])],
+@@ -238,7 +238,7 @@ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
+ AC_DEFUN([TORRENT_CHECK_ALIGNED], [
+   AC_MSG_CHECKING(the byte alignment)
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
+       #include <inttypes.h>
+       int main() {
+         char buf@<:@8@:>@ = { 0, 0, 0, 0, 1, 0, 0, 0 };
diff --git a/net/rtorrent/patches/120-fix-ncurses.patch b/net/rtorrent/patches/120-fix-ncurses.patch
new file mode 100644 (file)
index 0000000..f491de3
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/display/canvas.h
++++ b/src/display/canvas.h
+@@ -48,7 +48,7 @@ class Canvas {
+ public:
+   typedef std::vector<Attributes> attributes_list;
+-  Canvas(int x = 0, int y = 0, int width = 0, int height = 0);
++  Canvas(int x = 0, int y = 0, int width = 1, int height = 1);
+   ~Canvas() { delwin(m_window); }
+   void                refresh()                                               { wnoutrefresh(m_window); }